﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace TSL.Common
{
    public class nullResults
    {
        private static bool results;
        private static string run;
        public static bool Results
        {
            get
            {
                if (run == null)
                {
                    getDate();
                }
                return results;
            }
            set
            {
                results = value;
            }
        }

        private static void getDate()
        {
            ComResult res = new ComResult();
            string key = ConfigurationManager.AppSettings["Key"].ToString();
            string key2 = DEncrypt.DEncrypt.Encrypt(res.getCode());
            if (key == key2)
            {
                run = (1).ToString();
                results = true;
            }
            else
            {
                run = (2).ToString();
                results = false;
            }
        }

        public static string Run
        {
            get
            {
                if (run == null)
                {
                    getDate();
                }

                return run;
            }
        }

    }
}
